home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / tools / fixheader < prev    next >
Text File  |  1992-02-03  |  1KB  |  40 lines

  1. #!/bin/csh -f
  2. #
  3. # $Header: fixheader,v 1.2 92/02/03 01:46:58 ram Exp $
  4.  
  5. set quotehack = \$"Header: "\$
  6.  
  7. foreach file ($argv)
  8.     set range = (`fgrep -n ';;; ***********' $file | sed -e '3,$d' -e 's/:.*//'`)
  9.     if ($#range < 2) then
  10.         echo '**********' $file'': Could not find the header comment.
  11.         goto nextfile
  12.     endif
  13.     if ($range[2] > 12) then
  14.         echo '**********' $file'': Large header comment, you deal with it.
  15.         goto nextfile
  16.     endif
  17.  
  18.     echo fixing $file
  19.  
  20.     ed $file <<END_OF_ED_STUFF
  21. $range[1],$range[2]d
  22. $range[1]i
  23. ;;; **********************************************************************
  24. ;;; This code was written as part of the CMU Common Lisp project at
  25. ;;; Carnegie Mellon University, and has been placed in the public domain.
  26. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
  27. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
  28. ;;;
  29. (ext:file-comment
  30.   "$quotehack")
  31. ;;;
  32. ;;; **********************************************************************
  33. .
  34. w
  35. q
  36. END_OF_ED_STUFF
  37.  
  38.     nextfile:
  39. end
  40.